package com.demo.server.core;

import java.util.logging.Logger;

/**
 * @author:谢君臣
 * @Date:2021/7/25-15:57
 * @version:1.0
 * @function:
 */
public class Environment{
    protected final Logger logger;
    protected int port;
    private static volatile Environment environment;

    public Environment() {
        this.logger = Logger.getLogger("环境配置") ;
    }

    public static Environment newInstance() {
        if (environment==null){
            synchronized (Environment.class){
                if (environment == null)environment = new Environment();
            }
        }
        return environment;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public int getPort() {
        return port;
    }

}
